<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	template="/design/template.xhtml">
  <ui:define name="body">

  <h:form id="frmSeller">
    <h:inputHidden id="sellerId" value="#{sellerAction.seller.id}" /> 
    <p:panel id="pnlSeller" header="Dados fornecedor">

      <p:messages/>
      <h:panelGrid columns="3">
        <h:outputText value="Nome:" />
        <p:spacer width="8" />
        <p:inputText id="sellerName" value="#{sellerAction.seller.name}" style="width:300px;"
                     required="true" requiredMessage="Nome obrigatorio!">
        </p:inputText>
        <h:outputText value="Tipo Vendedor:"  />
        <p:spacer width="8" />
        <h:selectOneMenu id="sellerType" value="#{sellerAction.seller.type.id}" style="width:150px;" 
                         required="true" requiredMessage="Tipo obrigatorio!">  
          <f:selectItem itemValue="" itemLabel="Selecione um tipo"/>  
          <f:selectItems value="#{sellerAction.sellerTypesItems}"/>  
        </h:selectOneMenu>
        <h:outputText value="Nome usuário web:" />
        <p:spacer width="8" />
        <p:inputText id="sellerUserName" value="#{sellerAction.seller.webUserName}" style="width:300px;" >
        </p:inputText>
        <h:outputText value="Observação:" />
        <p:spacer width="8" />
        <p:inputTextarea id="sellerComents" value="#{sellerAction.seller.coments}" style="width:300px;" rows="4"></p:inputTextarea>
      </h:panelGrid>
      <p:spacer height="10" />
      <p:outputPanel id="pnlButons">
        <div align="left" id="divButons">
          <p:commandButton action="#{sellerAction.listSellers}" value="cancelar" update="pnlSeller" ajax="false" immediate="true" />
          <p:spacer width="10" />
          <p:commandButton action="#{sellerAction.editSeller}" value="alterar" update="pnlSeller" ajax="false" rendered="#{sellerAction.actionEdit}" />
          <p:commandButton action="#{sellerAction.insertSeller}" value="incluir" update="pnlSeller" ajax="false" rendered="#{sellerAction.actionInsert}" />
        </div>
      </p:outputPanel>			
    
    </p:panel>
  </h:form>

  </ui:define>
</ui:composition>
